<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
    <link rel="shortcut icon" href="http://img4.dangdang.com/bottom/validate.gif"/>  
</head>
<body id="login">
    <% include nav %>
    <div class="form">
        <form name="_form">
            <div class="hori logo"></div>
            <div class="hori clearfix">
                <div class="hori-name span3"><label for="">管理员账号：</label></div>
                <div class="hori-input span7"><input type="text" name="userlogin"/></div>
            </div>
            <div class="hori clearfix">
                <div class="hori-name span3"><label for="">密码：</label></div>
                <div class="hori-input span7"><input type="password" name="passlogin"/></div>
            </div>
            <div class="hori" style="position:relative;">
                <input class="submit-input" type="button" value="登录">  
                <div class="write-info" style="position:absolute;top:4px;font-size:12px;color:#333;display:none;color:orange;">亲，这两个都要填哦~</div>  
            </div>
        </form> 
    </div>
    <div class="mask hide">
        <div class="mask-info">
            正在为您跳转，如不能跳转请核对用户名密码
        </div>
    </div>
    <% include footer %>
    <script src="/js/require.js"></script>
    <script>
        require.config({
            paths: {
                'jquery': '/js/jquery-2.1.3.min',
                'remind':'/js/remind'
            }
        });

        require(['remind','jquery'], function(Remind,$) {
            var wai = $(".form"),
                innerbtn = $(".submit-input");
            Remind.remind(wai,innerbtn);

            $(".form input[type='button']").click(function(){
                var user = $("input[type='text']").val();
                var pass = $("input[type='password']").val();
                if(user!=''&&pass!=''){
                    //缓存用户信息
                    localStorage.setItem("username",user);
                    localStorage.setItem("userpass",pass);
                    
                    $(".mask").fadeIn(500);
                    setTimeout(function(){
                        $(".mask").fadeOut(500);
                        setTimeout(function(){
                            document._form.submit();
                        },1000)
                    },1500)
                }
            });


        })
    </script>
</body>
</html>